
<!-- Trail partial -->
<script id="services.cloudtrail.regions.id.trails.partial" type="text/x-handlebars-template">
    <div id="resource-name" class="list-group-item active">
      <h4 class="list-group-item-heading">{{name}}</h4>
    </div>
    <div class="list-group-item">
    <h4>Information</h4>
      <ul>
        <li class="list-group-item-text">ARN: <samp>{{arn}}</samp></li>
        <li class="list-group-item-text">Region: <samp>{{region}}</samp>
        {{#if scout_link}}
        <i class="fa fa-exclamation-triangle"></i> multi-region trail
        {{/if}}
        </li>
        {{#unless scout_link}}
        <li class="list-group-item-text">Organization Trail: {{is_organization_trail}}</li>
        <li class="list-group-item-text">Logging: <span class="cloudtrail.regions.{{region}}.trails.{{@key}}.IsLogging">{{convert_bool_to_enabled IsLogging}}</span></li>
        <li class="list-group-item-text">Start Logging Time: {{format_date StartLoggingTime}}</li>
        <li class="list-group-item-text">Stop Logging Time: {{format_date StopLoggingTime}}</li>
        <li class="list-group-item-text">Multi Region: <span class="cloudtrail.regions.{{region}}.trails.{{@key}}.IsLogging">{{convert_bool_to_enabled IsMultiRegionTrail}}</span></li>
        <li class="list-group-item-text">Management Events: <span id="cloudtrail.regions.{{region}}.trails.{{@key}}.cloudtrail-management-events-disabled">{{convert_bool_to_enabled ManagementEventsEnabled}}</span></li>
        <li class="list-group-item-text">Data Events: <span id="cloudtrail.regions.{{region}}.trails.{{@key}}.cloudtrail-data-events-disabled">{{convert_bool_to_enabled DataEventsEnabled}}</span></li>
        <li class="list-group-item-text">Include Global Services:
          <span id="cloudtrail.regions.{{region}}.trails.{{@key}}.GlobalServicesDuplicated">
            <span id="cloudtrail.regions.{{region}}.trails.{{@key}}.IncludeGlobalServiceEvents">
              <samp>{{#if IncludeGlobalServiceEvents}}Enabled {{#unless IsLogging}}(Trail disabled){{/unless}} {{else}}Disabled {{/if}}</samp>
            </span>
          </span>
        </li>
        <li class="list-group-item-text">Destination S3 Bucket Name: <samp><a href="javascript:showObject('services.s3.buckets.{{bucket_id}}')">{{getValueAt 'services.s3.buckets' bucket_id 'name'}}</a>/{{S3KeyPrefix}}</samp></li>
        <li class="list-group-item-text">Log File Validation Enabled: <span id="cloudtrail.regions.{{region}}.trails.{{@key}}.LogFileValidationDisabled">{{convert_bool_to_enabled LogFileValidationEnabled}}</span></li>
        <li class="list-group-item-text">KMS Key: <span id="cloudtrail.regions.{{region}}.trails.{{@key}}.cloudtrail-kms-key-unused"><samp>{{value_or_none KmsKeyId}}</samp></span></li>
        <li class="list-group-item-text">Latest CloudWatch Logs Delivery Time: <span id="cloudtrail.regions.{{region}}.trails.{{@key}}.TrailCloudwatchNoIntegration">{{format_date LatestCloudWatchLogsDeliveryTime}}</span></li>
        {{/unless}}
      </ul>
    </div>
</script>
<script>
  Handlebars.registerPartial("services.cloudtrail.regions.id.trails", $("#services\\.cloudtrail\\.regions\\.id\\.trails\\.partial").html());
</script>

<!-- Single EC2 instance template -->
<script id="single_cloudtrail_trail-template" type="text/x-handlebars-template">
    {{> modal-template template='services.cloudtrail.regions.id.trails' }}
</script>
<script>
    var single_cloudtrail_trail_template = Handlebars.compile($("#single_cloudtrail_trail-template").html());
</script>
